package construction.compositon;

import java.util.ArrayList;
import java.util.List;

public class College extends OrganizationComponent {
    private List<OrganizationComponent> list = new ArrayList<OrganizationComponent>();

    public College(String name, String des) {
        super(name, des);
    }

    @Override
    void add(OrganizationComponent organizationComponent) {
        list.add(organizationComponent);
    }

    @Override
    void remove(OrganizationComponent organizationComponent) {
        list.remove(organizationComponent);
    }

    @Override
    void print() {
        System.out.println("-------College--------");
        for (OrganizationComponent organizationComponent: list) {
            organizationComponent.print();
        }
    }
}
